<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>简历</title>
	</head>
	<style type="text/css">
		div {
			width: 485px;
			height: 280px;
			background-color: cadetblue;
			background-image: url(./img/晚霞.webp);
			color: bisque;
		}
		body{
			padding: 0;
			margin: 0;
			background-color: antiquewhite;
			
		}
		img{
			width: 485px;
			height: 280px;
		}
		a{
			color:bisque ;
		}
	</style>
	<body>
		<div id="father">
			<h1>工作经历</h1>
			<a href="#" onclick="add()">添加工作经历</a>
		</div>
	</body>
	<script type="text/javascript">
		function add() {
			var df = document.getElementById('father');
			var newdiv = document.createElement('div');
			newdiv.innerHTML =
				`<hr>公司名称：<input type="text" name="" id="" value="" />
				职位：<input type="text" name="" id="" value="" /><br />
				工作职责及内容描述：<br />
				<textarea rows="10" cols="65">
				</textarea><br /><a href="#" onclick="del(event)">删除工作经历</a><hr>`
			console.log('a')
			df.appendChild(newdiv)
		}

		function del(event) {
			var df = document.getElementById('father');
			var del_tar = event.target.parentElement;
			df.removeChild(del_tar)
		}
		onload = function() {
			add();
		}
	</script>
</html>
